package com.prawn.ift_collequipment.client;

import com.prawn.ift_collequipment.dao.EquipmentStatusDao;
import com.prawn.ift_collequipment.pojo.EquipmentStatus;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@RabbitListener(queues="equipmentstatus" )
public class MessageListener {
    @Autowired
    private EquipmentStatusDao equipmentStatusDao;
    @RabbitHandler
    public void showMessage(List<EquipmentStatus> message){
        equipmentStatusDao.saveAll(message);
    }
}
